class AddFieldsToEntries < ActiveRecord::Migration
  def self.up
    add_column :entries, :indexed_at, :datetime, :default => '1971-01-01 01:01:01', :null => false
    add_index :entries, :indexed_at
    add_column :entries, :relevance_calculated_at, :datetime, :default => '1971-01-01 01:01:01', :null => false
    add_index :entries, :relevance_calculated_at
    add_column :entries, :popular, :text, :default => ''
    add_column :entries, :relevant, :text, :default => ''
    add_column :entries, :other, :text, :default => ''
  end

  def self.down
    remove_index :entries, :indexed_at
    remove_index :entries, :relevance_calculated_at
    remove_column :entries, :indexed_at
    remove_column :entries, :relevance_calculated_at
    remove_column :entries, :popular
    remove_column :entries, :relevant
    remove_column :entries, :other
  end
end
